<?php

/*  lamp-shade_0.1
 *  License: GNU GPL v3
 *  File: ./modules/html/heading.php
 *  Last Mod.:  02/11/11 by Werner
 *  Authors:    Werner Roets
 *              Frank Adrian
 *  Description:
 *  This class provides functionality to make HTML headings
 *  like <h1></h1>.
 */

require_once("html_component.php");

class Heading extends Html_component
{
    public $Text;
    public $Size;
    
    public $Font_style;
    
    public function __construct($text, $size)
    {
        $this->Text = $text;
        $this->Size = $size;
    }
    
    protected function GenerateHtml()
    {
        //Here I create some shorter variables to use in the function
        $size = $this->Size;
        $fs = $this->Font_style;
        $txt = $this->Text;
        $html = "";
        
        //If the fontstyle is defined
        if($this->Font_style)
        {
            //Switch to determine style choice
            switch ($s)
            {
                case "Bold":
                    $html = "<$h><b>$txt</b></$h>";
                    break;
                case "Italic":
                    $html = "<$h><i>$txt</i></$h>";
                    break;
                case "Underlined":
                    $html = "<$h><u>$txt</u></$h>";
            }
        }
        //if the font style is not defined
        else
        {
            $html = "<$size>$txt</$size>";
        }
        $this->Html = $html;
    }
}
?>
